<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',	
	'name'=>'Kejati DKI',
	'defaultController'=>'Home',

	// preloading 'log' component
	'preload'=>array('log'),
	
	// path aliases
	'aliases'=>array(
		'bootstrap'=>realpath(__DIR__ . '/../extensions/bootstrap'),
	),
		
	// autoloading model and component classes
	'import'=>array(
		'bootstrap.widgets.*',
		'bootstrap.helpers.TbHtml',		
		'bootstrap.helpers.TbArray',
		'bootstrap.behaviors.TbWidget',
		'application.models.*',
		'application.components.*',
		'application.modules.user.models.*',
        'application.modules.user.components.*',
        'application.modules.rights.*',
        'application.modules.rights.components.*',
        'application.modules.admin.*',
        'application.modules.admin.components.*',
		'application.modules.admin.models.*',
		'application.modules.wewenang.*',
        'application.modules.wewenang.components.*',
		'application.modules.wewenang.models.*',
		
		'application.modules.poll.models.*',
		'application.modules.poll.components.*',
	),

	'modules'=>array(
		// uncomment the following to enable the Gii tool
		
		'gii'=>array(
			'generatorPaths'=>array('bootstrap.gii'),
			'class'=>'system.gii.GiiModule',
			'password'=>'4dm_kejat1',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),


		'user' => array(
            'returnUrl' => array('/user/profile'),
        ),
        'rights' => array(
        'install' => true, // Enables the installer.
        ),
        'admin',
        'wewenang',
		
	  
	  'poll' => array(
       // Force users to vote before seeing results
       'forceVote' => TRUE,
       // Restrict anonymous votes by IP address,
       // otherwise it's tied only to user_id 
       'ipRestrict' => TRUE,
       // Allow guests to cancel their votes
       // if ipRestrict is enabled
       'allowGuestCancel' => FALSE,
     ),
	 
		
	),

	// application components
	'components'=>array(
		'user' => array(
            // enable cookie-based authentication
            'allowAutoLogin' => true,
            'class' => 'RWebUser',
            'loginUrl' => array('/user/login'),
            'returnUrl' => array('/site/index'),
        ),
        'authManager' => array(
            'class' => 'RDbAuthManager',
        ),

		// uncomment the following to enable URLs in path-format
		
		'urlManager' => array(
            'urlFormat' => 'path',
            'rules' => array(
				'admin/<controller:\w+>/<action:\w+>/*'=>'admin/<controller>/<action>',
				'<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
            ),
        ),

		
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=kejaksaan',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => '',
			'charset' => 'utf8',
			'tablePrefix'=>'tbl_',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				/*
				array(
					'class'=>'CWebLogRoute',
				),
				*/
			),
		),
		'bootstrap'=>array(
			'class'=>'bootstrap.components.TbApi',
		),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'webmaster@example.com',
	),
);